package wowrl.gui;

import java.awt.Color;
import java.awt.Graphics;

import javax.swing.DefaultListModel;
import javax.swing.JPanel;


import wowrl.data.Item;
import wowrl.engine.WOWRL_Engine;

public class InventoryPanel extends JPanel {
	
	private Color backgroundColor;
	private WOWRL_Engine engine;
	DefaultListModel inventoryListModel;
	
	public InventoryPanel(WOWRL_Engine engine){
		
		// Set the engine
		this.engine = engine;
				
		// Specify the background color
		backgroundColor = new Color((float) 0.8, (float) 0.65, (float) 1);
		
		// Set the window's background color
		setBackground(backgroundColor);

		// Set the panel's size
		setSize(160,480);
				
		refresh();
	}
	
	public void paintComponent(Graphics g)
	{
		final int yOffset = 20;
		final Color defaultText = new Color((float) 0.0, (float) 0.0, (float) 0.0);
		
		//Set the text color
		g.setColor(defaultText);
		
		//Display each item in the list
		int y = 0;
		for (Item item : engine.getPlayer().inventory)
		{		
			y += yOffset;
			g.drawString(item.name + "(" + "N/A" + ")", 10, y);			
			
	    }
	}
	
	public void refresh(){
		repaint();
	}
}
